]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellEntry: Don't show "Show Password" menu if entry icon is disabled
authorRay Strode <rstrode@redhat.com>
Wed, 21 Jul 2021 18:01:48 +0000 (14:01 -0400)
committerMarge Bot <marge-bot@gnome.org>
Fri, 30 Jul 2021 14:17:07 +0000 (14:17 +0000)
Right now the Show Password menu is shown unconditionally for password
entries, ignoring the org.gnome.desktop.lockdown disable-show-password
key.

StShellEntry now honors that key for its peek icon, and there's little
reason for the peek icon and the menu to ever be out of sync.

This commit forces the menu and the icon to always be in sync, and
so makes the menu lock down work automatically, too.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/687>

js/ui/shellEntry.js

index 38f5a836d2837aeaf24002d9f9eee0dfe6803f0c..a2010b39e0cda116d92d5b63dc29e84b68baa086 100644 (file)
@@ -39,6 +39,10 @@ var EntryMenu = class extends PopupMenu.PopupMenu {
         item.connect('activate', this._onPasswordActivated.bind(this));
         this.addMenuItem(item);
         this._passwordItem = item;
+
+        this._entry.bind_property('show-peek-icon',
+            this._passwordItem, 'visible',
+            GObject.BindingFlags.SYNC_CREATE);
     }
 
     open(animate) {